<form action="<{link app=b2c ctl=site_passport act=post_login}>" method="post" id="form-login">
    <p class="mar-l-20"><b><{t}>登录类型<{/t}>：</b></p>
    <{if $close_autocomplete=='true' }>
    <!--<label for="" class="form-label">登录帐号：</label><span class="form-act"><{input type="text" autocomplete="off" class="action-account-check" name="uname" id="" value="{$loginName}" placeholder="邮箱地址" vtype="required" data-caution="请填写登录帐号" autofocus="autofocus"}></span></div>-->
    <div class="form-group" id="reg_email">
        <label for="" class="form-label"></label>
        <{input type="email" onblur="var regex = /^([a-z0-9_\.-])+@[a-z0-9-]+\.([a-z]{2,4}\.)?[a-z]{2,4}$/i; if(regex.test(this.value)) { try {rrApi.setEmail(this.value);}catch(e){}}" signup_type="email" autocomplete="off" name="uname" class="action-account-check form-control" value="{$loginName}" placeholder=$___b2c="邮箱"|t:'b2c' vtype="required" data-caution=$___b2c="请填写登录帐号，最少4个字符"|t:'b2c' autofocus id="email"}>
    </div>
    <{else}>
    <!--<label for="" class="form-label">登录帐号：</label><span class="form-act"><{input type="text" class="action-account-check" name="uname" id="" value="{$loginName}" placeholder="邮箱地址" vtype="required" data-caution="请填写登录帐号" autofocus="autofocus"}></span></div>-->
    <div class="form-group" id="reg_email">
        <label for="" class="form-label"></label>
		<span class="form-act"><{input type="email" signup_type="email" name="uname" class="action-account-check form-control" value="{$loginName}" placeholder=$___b2c="邮箱"|t:'b2c' vtype="required" data-caution=$___b2c="请填写登录帐号，最少4个字符"|t:'b2c' autofocus id="email"}>
    </div>
    <div class="form-group reg_phone" style="display:none; height:120px;"  id="reg_phone">
        <label for="" class="form-label"></label>
        <{if $phones}>
        <!--手机验证-->
        <select name="phone_setting" id="quhao" style="display:block;border: 1px solid rgb(221, 221, 221);padding: 10px;margin-bottom: 10px;">
            <{foreach from=$phones item=items}>
            <option sid="<{$items.length}>" value="<{$items.area}>"><{$items.country}><{$items.area}></option>
            <{/foreach}>
        </select>
        <{input type="text" name="pam_account[login_mobile]" placeholder=$___b2c="请填写手机号"|t:'b2c' vtype="required" style="width:220px;margin-left: 175px;" id="check_tel"}><span  style="color:red" class="validation-messagebox" id="phoneid"></span></span>
        <{else}>
        <{input type="text" name="pam_account[login_mobile]" placeholder=$___b2c="请填写手机号"|t:'b2c' vtype="required" id="check_tel"}><span  style="color:red" class="validation-messagebox" id="phoneid"></span></span>
        <{/if}>
    </div>
    <{/if}>
    <div class="form-group"><label for="" ><{t}>密码<{/t}>：</label><{input type="password" name="password" id="" placeholder=$___b2c="填写密码"|t:'b2c' vtype="required" class="form-control" data-caution=$___b2c="请填写密码"|t:'b2c'}></div>
    <div class="form-group action-verifycode action-need-verify <{if !$show_varycode}>hide<{/if}>">
        <label for="" class="form-label"><{t}>验证码<{/t}>：</label>

        <{input type="vcode" name="verifycode" class="verify-input form-control" placeholder=$___b2c="填写验证码"|t:'b2c' data-caution=$___b2c="请正确填写验证码"|t:'b2c' key='b2c'}>

    </div>
    <div class="form-group action-need-verify" style="display:none;">
        <label for="" class="form-label"><{t}>验证码：<{/t}></label>
      <span class="form-act">
        <{input type="text" name="mobileVcode" id="" placeholder=$___b2c="填写验证码"|t:'b2c' class="verify-input"}> <a href="<{link app=b2c ctl=site_passport act=send_vcode_sms}>" class="btn btn-caution action-get-verifycode"><span><span><{t}>获取短信验证码<{/t}></span></span></a>
      </span>
    </div>
    <div class="form-group-normal">
        <label for="" class="form-label"></label>

        <div class="checkbox forget_s over_clean">
            <label for="for_remember" class="form-sub-label fl">
                <input type="checkbox" name="is_remember" id="for_remember" class="x-check action-remember-account"<{if $site_b2c_remember != '0'}> checked="checked"<{/if}>> <{t}>记住帐号<{/t}>
            </label>
            <a class="small fr" href="<{link app=b2c ctl=site_passport act=lost}>"<{if $mini_passport==1}> target="_top"<{/if}>><{t}>忘记密码？<{/t}></a>
        </div>

    </div>
    <div class="form-group-normal">
        <label for="" class="form-label"></label>
        <{assign var='label' value=$___b2c='登陆'|t:'b2c'}>
        <{button type="submit" id="btn1" class="btn btn-primary login_true" label=$__b2c=$label|t:'b2c' rel="_request"}><br/>
    </div>

</form>
<script>
    window.addEvent('domready',function(){
        $("check_tel").addEvent('blur',function(){
            var str = this.get('value').trim();
            var obj = $$("#quhao option:selected");
            var num = obj[0].get('sid');
            var reg = new RegExp("^[1-9]\\d{"+(num-1)+"}$");

            if(str.length!=0){
                if(!reg.test(str)){
                    $("phoneid").set('html','<{t}>手机格式错误<{/t}>');
                }else{
                    $("phoneid").set('html','');
                }
            }
        });

        $("email").addEvent('blur',function(){
            var email = this.get('value');
            if(!email.test(/\S+@\S+/) && email){
                $('wz').set('html','<{t}>请填写正确的邮箱地址<{/t}>');
            }else{
                $('wz').set('html','');
            }
        })
    });

    $("btn1").addEvent('click', function(e){
        //yaCounter38355260.reachGoal('login');
        var reg = $$('.reg_style:checked').get('value');
        if(reg==0){
            var email = $("email").get('value');
            if(!email.test(/\S+@\S+/) && email){
                $('wz').set('html','<{t}>请填写正确的邮箱地址<{/t}>');
            }else{
                $('wz').set('html','');
            }
        }else{
            var str = $('check_tel').get('value').trim();
            var obj = $$("#quhao option:selected");
            var num = obj[0].get('sid');
            var reg = new RegExp("^[1-9]\\d{"+(num-1)+"}$");
            if(str.length!=0){
                if(!reg.test(str)){
                    $("phoneid").set('html','<{t}>手机格式错误<{/t}>');
                    e.stop();
                }else{
                    $("phoneid").set('html','');
                }
            }
        }
    });
</script>